import {defaultAxios as request } from '@/utils/http/index.js';
const api = "/api/tdengine/delete/";

/**
 * 查询任务
 */
export function list(data,timeout=12000){
	return request({
		url: api + 'list',
		method: 'post',
		data,
		timeout: timeout 
	});
}

/**
 * 初始化默认任务
 */
export function initDefaultTask(data,timeout=12000){
	return request({
		url: api + 'initDefaultTask',
		method: 'post',
		data,
		timeout: timeout 
	});
}


/**
 * 保存任务
 */
export function saveOrUpdate(data,timeout=60000){
	return request({
		url: api + 'saveOrUpdate',
		method: 'post',
		data,
		timeout: timeout 
	});
}

/**
 * 删除任务
 */
export function deleteById(params,timeout=12000){
	return request({
		url: api + 'deleteById',
		method: 'get',
		params,
		timeout: timeout 
	});
}


/**
 * 启动定时任务
 */
export function start(params,timeout=12000){
	return request({
		url: api + 'start',
		method: 'get',
		params,
		timeout: timeout 
	});
}

/**
 * 停止定时任务
 */
export function stop(params,timeout=12000){
	return request({
		url: api + 'stop',
		method: 'get',
		params,
		timeout: timeout 
	});
}

/**
 * 查看任务日志
 */
export function listDeleteLog(params,timeout=12000){
	return request({
		url: api + 'listDeleteLog',
		method: 'get',
		params,
		timeout: timeout 
	});
}